import { createRouter, createWebHistory } from 'vue-router'
import RoomLobby from '../components/RoomLobby.vue'
import GameScreen from '../GameScreen.vue'
import SocketDebug from '../components/SocketDebug.vue'

const routes = [
  {
    path: '/',
    name: 'RoomLobby',
    component: RoomLobby
  },
  {
    path: '/game',
    name: 'GameScreen',
    component: GameScreen,
    props: route => ({
      roomId: route.query.roomId
    })
  },
  {
    path: '/debug',
    name: 'debug',
    component: SocketDebug
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router